package com.xxl.dao.follow;

import com.xxl.dto.FollowBlogDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 操作数据库关注表,此表需要和粉丝表一起使用
 * @author xxl
 * @date 2023/3/30
 */
@Mapper
public interface FollowBlogMapper {
    /**
     * 根据关注名查询所有的被关注名
     * 根据被关注名查询所有的关注(粉丝)
     * @param followingUsername  关注名
     * @param followUsername 被关注名
     * @return List<FollowBlogDto>
     */
    List<FollowBlogDto> queryAllFollowsOrFollowings(@Param("followingUsername") String followingUsername,@Param("followUsername")String followUsername);

    /**
     * 关注
     * @param   followingUsername   关注人(粉丝)
     * @param   followUsername  被关注人(关注)
     * @return    int
     */
    int followUser(@Param("followingUsername")String followingUsername ,@Param("followUsername")String followUsername);
    /**
     * 取消关注
     * @param followingUsername  关注的人(粉丝)
     * @param  followUsername 被关注的人(关注)
     * @return int
     */
    int canselFollow(@Param("followingUsername")String followingUsername,@Param("followUsername")String followUsername);




}
